import java.util.List;
import java.util.Scanner;

public class Test {


    /**
     * 线序遍历创建二叉树
     * @param args
     */
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        TreeCode tree = new TreeCode();
        while(scanner.hasNextLine()) {
            String str  = scanner.nextLine();
            TreeCode.TreeNode root = tree.createTree(str);
            tree.inorder(root);
        }
    }

    public static void main1(String[] args) {
        TreeCode tree = new TreeCode();
        TreeCode.TreeNode root = tree.crateTree();
        tree.preOrder(root);
        System.out.println();
        System.out.println("层序遍历");
        tree.levelOrder(root);
        System.out.println();


        boolean bool = tree.isCompleteTree(root);
        System.out.println(bool);
    }
    public static void main(String[] args) {
        TreeCode tree = new TreeCode();
        TreeCode.TreeNode root = tree.crateTree();
        tree.preOrder(root);
        System.out.println();
        System.out.println("层序遍历");
        tree.levelOrder(root);
        System.out.println("+++++++++");
        String str = tree.tree2str(root);
        System.out.println(str);
        System.out.println("==========");
        List<Character> list = tree.inorderTraversal(root);
        System.out.println(list);
        System.out.println("后序遍历：");
        tree.postorder(root);
        System.out.println();
        System.out.println("中序遍历：");
        tree.inorder(root);
        System.out.println();
        System.out.println("前序遍历：");
        tree.preOrder(root);
    }
}
